home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-12-17 | 7.6 KB | 209 lines | [TEXT/MPS ] |
- #
- # ****************************************************************************
- #
- # File Name: Word.vu
- #
- # Contains: Quick look test script for Word version 4.0
- #
- # Written by: Kevin Avoy, Ken Landreth, Michael Leong, Gil Spencer et al
- #
- # Copyright: © 1993 by Apple Computer, Inc., all rights reserved.
- #
- # ****************************************************************************
- # C h a n g e H i s t o r y (most recent first):
- # ****************************************************************************
- #
- # Vers Date Author Description
- # ---- -------- ------ ---------------------------------------------
- # <1.0.5> 9/30/93 KTA Initialize gFileName prior to gApptitle being updated by
- # launchTwitch().
- # <1.0.2> 6/16/93 NAGA Renaming InitGlobals(ScriptLevel)to InitGlobals(ScriptLevel)
- # <1+> 5/25/93 NAGA Adding header and porting old files to follow new standards
- #
- # ****************************************************************************
- #
-
-
-
- ########################################################################
- # External libraries
- #=======================================================================
- Libraries "Output.Lib", "DoTasks.Lib","Draw.Lib","UserInterface.Lib","WordProcessor.Lib", "Font.Lib", "Globals.Lib", "LaunchQuit.Lib", "TCS.Lib";
-
-
- #########################################################################
- ######## Application Specific Tasks
- #########################################################################
-
-
- #########################################################################
- # InitAppGlobals()
- #========================================================================
- # Author: ML
- # Description: Sets up the app's globals.
- # Parameters: None
- # Returns: Nothing
- # Application: Word
- # Examples: InitAppGlobals()
- #========================================================================
- # History:
- #
- ########################################################################
- task InitAppGlobals()
- begin
-
- logstr('Setting up tool globals');
-
- global kClick, kDrag, kMultiDrag, kMultiClickDrag, kMultiClick;
- global kPalDocWind, kPalWind, kPullOffPal, kPopUpPal, kScrollPal;
- global kTabPaletteNum := 1;
- global kAlignPaletteNum := 2;
- global kSpacingPaletteNum := 3;
- global kParSpacePaletteNum := 4;
-
- global gPaletteList := {
- { #### Start Palette #1 - Tabs
- {121, 48, 217, 57,0}, # Location of tab palette relative to the window
- kPalDocWind, # Palette type
- {5,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {19,8}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #1
- { #### Start Palette #2 - Alignment
- {231, 48, 307, 57,0}, # Location of alignment palette relative to the window
- kPalDocWind, # Palette type
- {4,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {19,8}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #2
- { #### Start Palette #3 - Line spacing
- {321, 48, 377, 57,0}, # Location of Line spacing palette relative to the window
- kPalDocWind, # Palette type
- {3,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {19,8}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- }, #### End Palette #3
- { #### Start Palette #4 - Paragraph spacing
- {391, 48, 427, 57,0}, # Location of Line Paragraph spacing palette relative to the window
- kPalDocWind, # Palette type
- {2,1}, # Size of Tool matrix {numElemsWide,numElemsTall}
- {19,8}, # Offset between tools {h,v}
- 0, # Not used at this time
- 0 # Not used at this time
- } # End Palette #4
- };
-
- ### Word {Flag, Pattern, Line, Color}
- ### Palette Elements:= Tool#, Pal#, ToolName, ToolType, DblClktoEnd SetAttributes
- global TabLeftTool := { 1, 1, "Tab Left", kClick, 0, {0} };
- global TabCenterTool := { 2, 1, "Tab Center", kClick, 0, {0} };
- global TabRightTool := { 3, 1, "Tab Right", kClick, 0, {0} };
- global TabDecimalTool := { 4, 1, "Tab Decimal", kClick, 0, {0} };
- global TabVerticalTool := { 5, 1, "Tab Vertical", kClick, 0, {0} };
- global AlignLeftTool := { 1, 2, "Align Left", 0, 0, {0} };
- global AlignCenterTool := { 2, 2, "Align Center", 0, 0, {0} };
- global AlignRightTool := { 3, 2, "Align Right", 0, 0, {0} };
- global AlignLRTool := { 4, 2, "Align LR", 0, 0, {0} };
- global SingleSpaceTool := { 1, 3, "Single Space", 0, 0, {0} };
- global xSpaceTool := { 2, 3, "1-1/2 Space", 0, 0, {0} };
- global DoubleSpaceTool := { 3, 3, "Double Space", 0, 0, {0} };
- global NoParSpaceTool := { 1, 4, "No Par Space", 0, 0, {0} };
- global ParSpaceTool := { 2, 4, "Par Space", 0, 0, {0} };
-
- # global Tool list
-
- global RulerRect:= {17,32,20,43};
- global gWindowInset := {0,0,0,0};
-
- global TabToolList:={ TabLeftTool,
- TabCenterTool,
- TabRightTool,
- TabDecimalTool,
- TabVerticalTool
- };
-
- global OtherToolList:={ AlignLeftTool,
- AlignCenterTool,
- AlignRightTool,
- AlignLRTool,
- SingleSpaceTool,
- xSpaceTool,
- DoubleSpaceTool,
- NoParSpaceTool,
- ParSpaceTool
- };
-
- global RulerMenuPath := {'Show Ruler','Format'};
-
- global gDismissAboutBox:='Cancel';
-
- logstr('Setting up font globals');
-
- ### font characteristic lists
- global gFontSizeList := {'9','10','12','14','18', '24'};
- global gFontStyleList := {'Bold','Italic','Outline', 'Underline','Shadow'};
-
- ### Name of the Plain (style) menu item ####
- global gPlainStyle := "Plain Text"; # Plain-Style menu item
-
- ### How to get to the next line
- global gNextLineMethod := 4;
- ### 1 - ReturnKey, 2 - EnterKey, 3 - DownArrow Key, 4 - TabKey, {} - Move/Click, {'Untitled'} - Move relative to the window titled 'Untitled' /Click
-
- ### Does moving to the next line clear all font info
- global gNextLineClearsFontSettings := 0;
-
- end; #InitAppGlobals
-
- #########################################################################
- # Views()
- #========================================================================
- # Author: ML
- # Description: Change Views.
- # Parameters: None
- # Returns: Nada
- # Application: Word
- # Examples: Views();
- #========================================================================
- # History:
- #
- ########################################################################
- task Views()
- begin
- LogStr( " Changing Views ");
- SelectMenuItem("Print Preview", "File");
- selectButton('Page View');
- Println;
- end;
-
- ################################################################################
- #################### Main script ####################
- ################################################################################
- script Word (ScriptLevel:= -1)
- begin
- InitGlobals(ScriptLevel);
- InitDraw();
- InitFonts();
- global gAppTitle := 'Microsoft Word';
- global gAppVersion := '4';
- global gFileName := "@!@-{gBuildVers}-{gAppTitle}"; # This is used in SaveAs when saving files
- SuiteStart('Word.vu'); # begin a new test suite
- if LaunchTwitch("{gAppTitle}",gAliasDirectory) # launch or twitch to your app
- begin
- InitAppGlobals();
- (*
- *)
- DoSetUpApp(,,,,1,1);
- DoText();
- if (gAppTestLevel = 2)
- DoWPTools();
- Views();
- DoWindow();
- DoCloseApp(,'Cancel');
- end; # if LaunchTwitch("{gAppTitle}",gAliasDirectory)
- SuiteEnd();
- end;
-